package com.itsv.news;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;

import com.itsv.news.utils.ViewArea;

public class ShowImageActivity extends Activity {
	 private Bitmap bitmap;  
	 private LinearLayout.LayoutParams parm;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.showimage);
		RelativeLayout iv = (RelativeLayout) findViewById(R.id.showImage);
		parm = new LinearLayout.LayoutParams(
				LinearLayout.LayoutParams.FILL_PARENT,
				LinearLayout.LayoutParams.FILL_PARENT);
        Intent mIntent = getIntent();  
        byte buff[]=mIntent.getByteArrayExtra("image");  
        bitmap = BitmapFactory.decodeByteArray(buff, 0, buff.length);  
          
//        BitmapDrawable mBitmapDrawable = new BitmapDrawable(bitmap);  
//        iv.setBackgroundDrawable(mBitmapDrawable); 
        ViewArea viewArea = new ViewArea(ShowImageActivity.this, bitmap); 
        iv.addView(viewArea,parm);
	}
}
